#include "node.h"

int Node::count_to_end() const
{
    const Node * p = this;
    int i = 0;
    while(p != NULL)
    {
        ++ i;
        p = p->m_next;
    }
    return i;
}

Node * const Node::end() const
{
    const Node * p = this;
    while(p->m_next != NULL)
    {
        p = p->m_next;
    }
    return const_cast<Node *>(p);
}

